<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on April 15, 2009 at 1:25:06 pm</time-stamp>


<class>
<name>EmergencyOrderReport</name>
<environment>SupplyChain</environment>
<super>UI.SimpleDialog</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>data orders </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.EmergencyOrderReport class</class-id> <category>interface specs</category>

<body package="SupplyChain" selector="windowSpec">windowSpec
	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

	&lt;resource: #canvas&gt;
	^#(#{UI.FullSpec} 
		#window: 
		#(#{UI.WindowSpec} 
			#label: 
			#(#{Kernel.UserMessage} 
				#key: #EasyChart2 
				#defaultString: 'Supplier Quantity Report' 
				#catalogID: #BGOK ) 
			#min: #(#{Core.Point} 20 20 ) 
			#bounds: #(#{Graphics.Rectangle} 640 512 905 703 ) ) 
		#component: 
		#(#{UI.SpecCollection} 
			#collection: #(
				#(#{UI.ChartViewSpec} 
					#layout: #(#{Graphics.LayoutFrame} 5 0 5 0 -5 1 -5 1 ) 
					#model: #data 
					#chartType: #BG_PieChartView 
					#dataSeries: 
					#(#{UI.ChartDataSpec} 
						#series: #(
							#(#{UI.ChartDataSetSpec} 
								#name: 'Data1' ) 
							#(#{UI.ChartDataSetSpec} 
								#isData: false 
								#name: 'Labels' ) ) ) 
					#yAxis: 
					#(#{UI.ChartingValueAxisSpec} 
						#scale: 
						#(#{UI.ChartingScaleSpec} 
							#invert: true 
							#restrictions: #(#auto ) ) ) ) ) ) )</body>
</methods>

<methods>
<class-id>SupplyChain.EmergencyOrderReport class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	^super new initialize.</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.EmergencyOrderReport</class-id>
<body>SupplierQuantityReport shows a bar chart of quantities of items provided for a specific Item/Supplier by POS Location.

Instance Variables:
	Chart1	&lt;ValueHolder&gt;	A Bar Chart
	retailers	&lt;OrderedCollection&gt;A list of retailers
	suppliers	&lt;OrderedCollection&gt;	 A list of suppliers

</body>
</comment>

<methods>
<class-id>SupplyChain.EmergencyOrderReport</class-id> <category>aspects</category>

<body package="SupplyChain" selector="data">data

	| normal priority inner outer inner2 |

	normal:= 0.	" counter for normal priority answers	"
	priority:= 0.  " counter for high priority answers	"
	outer:= OrderedCollection new.
	orders do: [:i |
		i priority ifFalse: [
			normal:= normal + 1.
		].
		i priority ifTrue:[
			priority:= priority + 1.
		].
	].
	inner:= OrderedCollection new.
	inner add: normal.
	inner add: 'Normal Priority'.
	
	inner2:= OrderedCollection new.
	inner2 add: priority.
	inner2 add: 'High Priority'.

	outer add: inner.
	outer add: inner2.

	^outer.</body>
</methods>

<methods>
<class-id>SupplyChain.EmergencyOrderReport</class-id> <category>accessing</category>

<body package="SupplyChain" selector="orders">orders

	^orders</body>

<body package="SupplyChain" selector="orders:">orders: anObject

	orders := anObject.
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.EmergencyOrderReport</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	super initialize.
	" *** Edit the following to properly initialize instance variables ***"
	orders := OrderedCollection new.
	
	" *** And replace this comment with additional initialization code *** "
	^self</body>
</methods>

</st-source>
